package com.ldc.framework.api

import com.ldc.commonlibs.common.RspModel
import com.ldc.commonlibs.common.RspPagingModel
import com.ldc.commonlibs.http.HttpServer
import com.ldc.framework.model.*
import com.ldc.framework.model.RankModel
import retrofit2.http.*

interface FrameworkServer : HttpServer {


    // banner
    @GET(value = "banner/json")
    suspend fun bannerList(): RspModel<ArrayList<BannerModel>>


    // 首页文章
    @GET(value = "article/list/{page}/json")
    suspend fun articleList(@Path(value = "page") page: Int = 1): RspModel<RspPagingModel<ArticleModel>>


    // 体系
    @GET(value = "tree/json")
    suspend fun systemList(): RspModel<SystemModel>


    //体系下稳住啊个
    // article/list/0/json?cid=60
    @GET(value = "article/list/{page}/json")
    suspend fun articleList(
        @Path(value = "page") page: Int,
        @Query(value = "cid") cid: String
    ): RspModel<RspPagingModel<ArticleModel>>


    // 项目
    @GET(value = "project/tree/json")
    suspend fun projectClassList(): RspModel<ProjectClassModel>

    //项目列表数据
    @GET(value = "/project/list/{page}/json")
    suspend fun projectList(
        @Path(value = "page") page: Int = 0,
        @Query(value = "cid") cid: String
    ): RspModel<RspPagingModel<ArticleModel>>


    // 导航
    @GET(value = "/navi/json")
    suspend fun NaviJson(): RspModel<NavArticleModel>


    //问答
    @GET(value = "wenda/list/{page}/json")
    suspend fun WenDa(@Path(value = "page") page: Int = 0): RspModel<RspPagingModel<ArticleModel>>


    //微信公众号
    @GET(value = "wxarticle/chapters/json")
    suspend fun wxarticle(): RspModel<ProjectClassModel>


    // rank
    @GET(value = "coin/rank/{p}/json")
    suspend fun rankList(@Path(value = "p") p: Int = 0): RspModel<RspPagingModel<RankModel>>

    // 积分排行版
    @GET(value = "/lg/coin/list/{p}/json")
    suspend fun coinList(@Path(value = "p") p: Int = 1): RspModel<RspPagingModel<CoinModel>>

    //文章收藏
    @GET(value = "lg/collect/list/{p}/json")
    suspend fun collectList(@Path(value = "p") p: Int = 0): RspModel<RspPagingModel<ColletModel>>

    //热词
    @GET(value = "hotkey/json")
    suspend fun hotkey(): RspModel<ArrayList<HotKeyModel>>

    // 搜索
    @FormUrlEncoded
    @POST("article/query/{page}/json")
    suspend fun queryKey(
        @Path(value = "page") page: Int = 0,
        @Field("k") key: String
    ): RspModel<RspPagingModel<ArticleModel>>


}